﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace DisplayDemo
{
    public static class FrameExtensions
    {
        public static async Task<ImageData> ReadImage(this ISubscription<(ImageData, object)> sub)
        {
            var (img, _) = await sub.Read().ConfigureAwait(false);
            return img;
        }
    }

    public record ImageData(int Width, int Height, byte[] Data, PixelFormat Format);
}
